package cn.tedu.charging.order;


import cn.tedu.charging.common.pojo.param.GunStatusUpdateParam;
import cn.tedu.charging.common.pojo.vo.StationInfoVO;
import cn.tedu.charging.common.pojo.vo.UserInfoVO;
import cn.tedu.charging.common.result.JsonResult;
import cn.tedu.charging.order.feign.DeviceClient;
import cn.tedu.charging.order.feign.UserClient;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class FeignClient {


    @Autowired
    private DeviceClient deviceClient;
    @Autowired
    private UserClient userClient;

    @Test
    public void userTest() {
        for (int  i=1;i<=9;i++){
            JsonResult<UserInfoVO> userInfo = userClient.getUserInfo(1);
            System.out.println(userInfo.getData());
        }
    }

    @Test
    public void deviceTest() {


        for (int  i=1;i<=9;i++){
            JsonResult<StationInfoVO> stationInfo = deviceClient.getStationInfo(1);
            System.out.println(stationInfo.getData());

            GunStatusUpdateParam gunStatusUpdateParam=new GunStatusUpdateParam();
            gunStatusUpdateParam.setGunId(1);
            JsonResult<Boolean> booleanJsonResult = deviceClient.updateGunStatus(gunStatusUpdateParam);
            System.out.println(booleanJsonResult.getData());
        }
    }
}
